package pl.edu.agh.uhm.serveragent.devices.vm;

import java.util.Dictionary;

import org.osgi.service.upnp.UPnPAction;
import org.osgi.service.upnp.UPnPLocalStateVariable;
import org.osgi.service.upnp.UPnPStateVariable;


public class GetNameAction implements UPnPAction{

	final private String NAME = "get hypervisor name";
	final private String HYPERVISOR_NAME= "Result";
		
	final private String[] IN_ARG_NAMES = new String[]{};
	final private String[] OUT_ARG_NAMES = new String[]{HYPERVISOR_NAME};
	final private UPnPLocalStateVariable hypervisorNameSV= new VMNameSV();
	
	public GetNameAction() {
	}

	
	public String[] getInputArgumentNames() {
		return IN_ARG_NAMES;
	}

	
	public String getName() {

		return NAME;
	}

	
	public String[] getOutputArgumentNames() {
		return OUT_ARG_NAMES;
	}

	
	public String getReturnArgumentName() {
		return HYPERVISOR_NAME;
	}

	
	public UPnPStateVariable getStateVariable(String arg0) {
		return hypervisorNameSV;
	}

	
	public Dictionary invoke(Dictionary args) throws Exception {
		StringBuilder sb=new StringBuilder();
		sb.append("vm names:");

		args.put(HYPERVISOR_NAME,sb.toString());
		
		return args;
		
	}

}
